/*
 * @Description:
 * @Author: anqing.liang
 * @Date: 2021-07-19 15:47:50
 * @LastEditTime: 2021-07-30 10:35:02
 * @LastEditors: anqing.liang
 */
export enum ApproveHistoryType {
    Modal = 'Modal',
    Url = 'Url',
}
//审批动作
export enum ApproveActionType {
    Approved = 'Approved',
    Rejected = 'Rejected',
    Approving = 'Approving',
    CarbonCopy = 'CarbonCopy',
}
//数据显示类型
export enum ApproveDisplayType {
    All = 'All',
    Last = 'Last',
    First = 'First',
}
export class ApproveAction {
    static actionMap = [
        { value: ApproveActionType.Approved, meaning: '通过' },
        { value: ApproveActionType.Rejected, meaning: '拒绝' },
        { value: ApproveActionType.Approving, meaning: '审批中' },
        { value: ApproveActionType.CarbonCopy, meaning: '抄送' },
    ]
    static getMeaning(value: ApproveActionType) {
        if (!Boolean(value)) return null;
        return this.actionMap.filter(i => i.value === value)[0]?.meaning;
    }
    static getStatusColor(value: ApproveActionType) {
        let color = '';
        switch (value) {
            case ApproveActionType.Approved:
                color = 'green';
                break;
            case ApproveActionType.Rejected:
                color = 'red';
                break;
            case ApproveActionType.Approving:
                color = 'geekblue';
                break;
            case ApproveActionType.CarbonCopy:
                color = 'orange';
                break;
            default:
                break;
        }
        return color;
    }
}